#pragma once

class FinalQuad {

	friend class Engine;
	
protected:

	static const GLfloat finalQuadData[16];

	GLuint vbo;
	
	GLuint vao;
	
	void draw();
	
public:
	
	FinalQuad();
	
	~FinalQuad();
	
};

const GLfloat FinalQuad::finalQuadData[16] = {
	-1,-1, 0, 0,
	 1,-1, 1, 0,
	-1, 1, 0, 1,
	 1, 1, 1, 1
};

FinalQuad::FinalQuad(){
	glGenVertexArrays(1,&vao);
	glBindVertexArray(vao);
	glGenBuffers(1,&vbo);
	glBindBuffer(GL_ARRAY_BUFFER,vbo);
	glBufferData(GL_ARRAY_BUFFER,sizeof(GLfloat)*16,finalQuadData,GL_STATIC_DRAW);
	glVertexAttribPointer(0,4,GL_FLOAT,GL_FALSE,0,0);
	glEnableVertexAttribArray(0);
}
	
FinalQuad::~FinalQuad(){
	glDeleteBuffers(1,&vbo);
	glDeleteVertexArrays(1,&vao);
}
	
void FinalQuad::draw(){
	glBindVertexArray(vao);
	glDrawArrays(GL_TRIANGLE_STRIP,0,4);
};
